<%@ Page Language="C#" MasterPageFile="~/astro-admin/common/AdminMasterPage.master" AutoEventWireup="true" Inherits="astro_admin_site_options_comments_Default" Title="Astro - Your Comment &amp; Spam Settings" Codebehind="Default.aspx.cs" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeaderRegion" Runat="Server">
  <script type="text/javascript" src="../../common/js/jquery-ui-1.7.1.custom.min.js"></script>	
	<script type="text/javascript">
	  $(function () {
//	    $("#sort_customfields").sortable({
//	      items: 'li',
//	      opacity: 0.50,
//	      update: function (event, ui) {
//	        $.get('/astro-admin/ajax.ashx?command=customFieldSort&categoryId=<%= Request.QueryString["category"] ?? "-1" %>&ids=' + $(this).sortable('toArray'));
//	      }
//	    });
	  });
	</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainRegion" Runat="Server">
<h1>Your Comment &amp; Spam Settings</h1>
<Z:Breadcrumbs runat="server" SectionName="Comments" />

<div id = "messages_form">
    
    <div id="post_form_container" class="FormBlock">
    <Glow:TabbedPanes ID="TabbedPanes1" runat="server" PanesCssClass="TabPane"   TabSetCssClass="TabPaneTabSet"    TabCssClasses="TabPaneTab"    TabSelectedCssClasses="TabPaneTabSelected"    TabHoverCssClasses="TabPaneTabHover">
     <Glow:TabbedPane runat="server" ID="TabbedPane1">
        <Tab>Comment Settings</Tab>
        <Content>
            <z:StatusMessage runat="Server" ID = "Message" />

            <h3>Comment Settings</h3>
            <h2><asp:CheckBox ID="EnableComments" Text="Enable Comments" runat="Server" /><br /><span class="form_tip">Controls if comments are enabled by default on new posts (and via <a href="http://en.wikipedia.org/wiki/MetaWeblog" target="_blank">MetaBlog API</a>).</span></h2> 
        
            <h2>Comment Days: <span class="form_label">Number of days new posts will accept comments</span></h2>
            <asp:DropDownList runat="Server" ID = "CommentDays" Style="width:200px;">
                <asp:ListItem Text="No days, Comments are Disabled" Value = "0" />
                <asp:ListItem Text="1 day" Value="1" />
                <asp:ListItem Text="2 days" Value="2" />
                <asp:ListItem Text="3 days" Value="3" />
                <asp:ListItem Text="1 week" Value="7" />
                <asp:ListItem Text="2 weeks" Value="14" />
                <asp:ListItem Text="1 month" Value="30" />
                <asp:ListItem Text="2 months" Value="60" />
                <asp:ListItem Text="3 months" Value="90" />
                <asp:ListItem Text="6 months" Value="180" />
                <asp:ListItem Text="1 year" Value="365" />
                <asp:ListItem Text="Forever" Value="-1" />
            </asp:DropDownList>
        
            <h2>Email Comments To: <span class="form_label">Seperate multiple email addresses with a ';' semi-colon</span></h2>
            <asp:TextBox CssClass = "large" runat="Server" id="txtEmail" />  
        
        
            <h3>Spam Settings</h3>
        
            <h2>Spam Score: <span class="form_tip">The threshold for flagging a comment as spam (relies on badwords.txt under the _utility/spam folder)</span></h2>
            <asp:TextBox CssClass = "large" runat="Server" id="txtSpamScore" style="width: 75px;" />  
        
            <h2><asp:CheckBox ID="chkUseAkismet" Text="Use Akismet For Spam" runat="Server" /> <span class="form_tip"><a href="http://akismet.com/" target="_blank">Akismet</a> is a free (and commerical) service you can use to prevent spam.</span></h2>
         
            <div id="akismetSettings" runat="server">
                <h2>Akismet Id: <span class="form_tip"></h2>
                <asp:TextBox CssClass = "large" runat="Server" id="txtAkismetId" />  
        
                <h2>Akismet Score: <span class="form_tip">The threshold for flagging a comment as spam via akismet</span></h2>
                <asp:TextBox CssClass = "large" runat="Server" id="txtAkismetScore" style="width: 75px;"   />  
            </div>

            <div class="submit">
                <div id="buttons">
                    <asp:Button runat="Server" ID="SettingsSave" Text = "Update Settings" OnClick="SettingsSave_Click" />
                    <asp:HyperLink ID ="Cancel_Edit" Text = "(Cancel)" NavigateUrl="~/astro-admin/site-options/" runat="Server" />
                </div>
            </div>
          </Content>
      </Glow:TabbedPane>
      <Glow:TabbedPane runat="server" ID="CustomFieldsTab">
        <Tab ID="">Comment Types</Tab>
        <Content>
            <asp:MultiView runat="Server" ID = "FormViews" ActiveViewIndex="0">
              <asp:View ID = "NewFieldView" runat="Server">

                   <div id="Div1" class="FormBlock abc">
             
                      <h3>Add a new comment type</h3>
                
                      <table>
                          <tr>
                              <td>Name:</td>
                              <td><asp:TextBox runat="Server" ID = "txtName" CssClass="Small" TabIndex="1" /></td>
                          </tr>
                      </table>
                 
                   </div>
             
                  <div class="submit">
                      <div id="Div2">
                          <asp:Button ID="NewFieldBTN" runat="Server" Style="font-weight:bold" Text = "Add Comment Type"  OnClick="NewFieldBTN_Click" TabIndex="4" />
                      </div>
                  </div>

                  <div id="CustomFieldList" runat="server" class="FormBlock">
            
                      <h3>Existing comment types</h3>
                
                      <Z:Repeater runat="Server" ID = "ExistingItems" ShowHeaderFooterOnNone="False" >
                          <NoneTemplate>
                              <z:StatusMessage ID="StatusMessage1" runat="Server" Text="No comment types were found. Why not create one?" Type="Warning" />
                          </NoneTemplate>
                          <HeaderTemplate>
                              <ul class="listboxes" id="sort_customfields">
                          </HeaderTemplate>
                          <ItemTemplate>
                              <li id='<%# Eval("Id") %>'>
                                  <div class="nonnested">
                                      <div class="title"><%# Eval("Name") %></div>
                                      <div class="commands"><a href="Default.aspx?id=<%# Eval("id") %>&type=true">Edit</a>  | <asp:LinkButton ID="lbDelete" runat="server" CommandArgument='<%# Eval("Id") %>' OnCommand="lbDelete_Command" Text="Delete" CausesValidation="false" /></div>
                                  </div>
                              </li>
                          </ItemTemplate>
                          <FooterTemplate>
                              </ul>
                          </FooterTemplate>
                      </Z:Repeater>
                
                  </div>

              </asp:View>
        
              <asp:View runat="Server" ID = "EditFieldView">

                  <div id="Div3" class="FormBlock abc">

                      <h2>Name: <span class="form_tip">(you should not change this value after have published a post)</span></h2>
                      <asp:TextBox runat="Server" ID = "ExistingName" CssClass = "large" TabIndex="1" />

                      <h2>Description: <span class="form_tip">(a short description about the field. It will render just like this message)</span></h2>
                      <asp:TextBox runat="Server" ID = "ExistingDescription" CssClass = "large" TabIndex="2" />
                  </div>

                  <div class="submit">
                      <div id="Div4">
                          <asp:Button ID="UpdateFieldBTN" runat="Server" Style="font-weight:bold" Text = "Update Field"  OnClick="UpdateFieldBTN_Click" TabIndex="81" />
                          <asp:HyperLink NavigateUrl="Default.aspx?type=true" Text = "(Cancel)" TabIndex="82" runat="server" />
                      </div>
                  </div>    
        
              </asp:View>
        
          </asp:MultiView>
        </Content>
      </Glow:TabbedPane>
    </Glow:TabbedPanes>
    </div>
</div>

<script language="javascript">
    $('#<%= chkUseAkismet.ClientID %>').click(function() {
    $('#<%= akismetSettings.ClientID %>').slideToggle();
    });
</script>

</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="SideBarRegion" Runat="Server">
</asp:Content>

